from pywinauto.application import Application

# app = Application("uia").start(r"notepad.exe")
app = Application("uia").connect(path="notepad.exe")

# dlg = app['Untitled - Notepad']
# dlg = app['Notepad']
dlg = app['*无标题 - 记事本']
# dlg = app.window(best_match="Untitled - Notepad")
# dlg.print_control_identifiers()
dlg["Edit"].type_keys("sdfsdf11111111111skjfsdkf")
dlg["Edit"].print_control_identifiers()
# dlg.menu_select(r"File -> Open")
# dlg.type_keys('^O')
# dlg.close()
